package com.zxj.geekstudy.spring;

import lombok.Data;
import lombok.ToString;
import org.springframework.beans.factory.InitializingBean;

@Data
@ToString
public class Banana implements InitializingBean {

    private Integer id;
    private String name;

    public void init() {
        System.out.println("init-method初始化执行:" + this);
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("afterPropertiesSet:" + this);
        this.setName(name.replace("1", "2"));
    }
}
